<template>
  <el-tag :type="isYes ? 'success' : 'danger'">{{ isYes ? '是' : '否' }}</el-tag>
</template>

<script>
export default {
  name: 'YesOrNoTag',
  props: {
    flag: {
      type: [Number, Boolean, String],
      required: true,
    },
  },
  computed: {
    isYes() {
      return typeof this.flag === 'string' ? parseInt(this.flag) : this.flag;
    },
  },
};
</script>
